import React from 'react'
import { Cell, Image ,Button} from 'react-vant';
import { PROPSTYPE } from '../Type/Store.d';

interface CHILDRENPROPSTYPE {
    item?:any;
    obj?:any
    onclickBtn?:any;
}
function ChildrenItem(props:CHILDRENPROPSTYPE) {
    let {item,obj,onclickBtn} = props;

    const onclickBtnss = (id:number,item:PROPSTYPE)=>{
        onclickBtn(id,item)
    }
    return (
        <div className='ChildrenItem'>
            <Cell
                center
                title={item ? item.txt : obj.txt}
                label={item ? item.tcon : obj.tcon}
                icon={ <Image width={44} height={44} src={item ? item.src: obj.src} round/> }
                value={<Button type="info" size="small">开始游戏</Button>}
                onClick={()=>onclickBtnss(item.id,item)}
            />
        </div>
    )
}

export default ChildrenItem